package yag.battle.manager;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import yag.battle.model.Army;
import org.springframework.stereotype.Component;
import yag.battle.model.Battle;

/**
 * Created by user on 25.08.2014.
 */
@Component
public class BattleManager {
    @Autowired
    private ApplicationContext applicationContext;

    public int battle(Army army1, Army army2) {
        Battle battle = applicationContext.getBean(Battle.class);
        battle.setFirstArmy(army1);
        battle.setSeconArmy(army2);
        return battle.doBattle();
    }

}
